<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/pages/safeai/jsp/common/taglibs.jsp"%>
<html>
	<head>
		<title></title>
		<link href="${ctx}/css/safeai/together.css" rel="stylesheet" type="text/css">
		<link type="text/css" rel="StyleSheet" media="all" href="${ctx}/css/combined.css">
<link type="text/css" rel="StyleSheet" media="all" href="${ctx}/css/global.css">
		<script type="text/javascript" src="${ctx}/js/calendar.js"></script>
        <script type="text/javascript" src="${ctx}/js/calendar-zh.js"></script>
        <script type="text/javascript" src="${ctx}/js/calendar-setup.js"></script>
		<script type="text/javascript">
            // Hack to avoid bug in jscalendar - JRA-7713
            if (!Calendar._TT["WEEKEND"]) Calendar._TT["WEEKEND"] = "0,6";
            if (!Calendar._TT["DAY_FIRST"]) Calendar._TT["DAY_FIRST"] = "Display %s first";
        </script>
		<script type="text/javascript" src="${ctx}/script/common/common.js"></script>
		<%@ include file="/pages/safeai/jsp/common/meta.jsp"%>
	</head>

	<body>
    	<form action="${ctx}/pw_members/pw_membersManage.do?method=query" method="post" name="pw_membersForm">
			<table width="100%" align="center">
				<tr> 
					<td class="td_01">ID：</td>
					<td class="td_03"><input type="text" name="pw_members.uidStr" id="puid"value="${pwMember.uidStr}"/></td>
					<td class="td_01">登录名：</td>
					<td class="td_03"><input type="text" name="pw_members.username" value="${pwMember.username}"/></td>
				</tr> 
				<tr>
					<td class="td_01">真实姓名：</td>
					<td class="td_03"><input type="text" name="pw_members.realName" value="${pwMember.realName}"/></td>
					<td class="td_01">email：</td>
					<td class="td_03"><input type="text" name="pw_members.email" value="${pwMember.email}"/></td>
				</tr> 
				<tr>
					<td class="td_01">手机：</td>
					<td class="td_03"><input type="text" name="pw_members.mobile" value="${pwMember.mobile}"/></td>
					<td class="td_01">Vip卡号：</td>
					<td class="td_03"><input type="text" name="pw_members.vip" id="vip" value="${pwMember.vip}"/></td>
				</tr> 
				<tr>
					<td class="td_01">注册日期：</td>
					<td class="td_03">
					<input name="pw_members.redate" id="created:after" value="${pwMember.redate}"  type="text" / style="background-image:url(${ctx}/images/cal.gif); background-repeat:no-repeat; background-position:left;padding-left:25px; cursor:hand;width:176px"> 
						<script type="text/javascript">
						    Calendar.setup({
						
						        firstDay       :    0,                  // first day of the week
						        inputField     :    "created:after",     // id of the input field
						        button         :    "created:after_trigger_c",  // trigger for the calendar (button ID)
						        align          :    "Bl",           // alignment (defaults to "Bl")
						        singleClick    :    true,
						             ifFormat       : "%y/%m/%d"      // our date only format
						         });
		                 </script>
		            </td>
					<td class="td_01">品牌：</td>
					<td class="td_03">
						<select name="pw_members.brandId"> 
							<option value="null">选择品牌</option>
							<logic:iterate id="bList" name="BrandList"> 
								<logic:equal name="bList" property="id" value="${pwMember.brandId}">
									<option value="<bean:write name="bList" property="id"/>" selected><bean:write name="bList" property="name"/></option>
							    </logic:equal>
								<logic:notEqual name="bList" property="id" value="${pwMember.brandId}">
									<option value="<bean:write name="bList" property="id"/>"><bean:write name="bList" property="name"/></option>
							    </logic:notEqual>
						    </logic:iterate>
					    </select>
					</td>
				</tr> 
				<tr>
					<td colspan="5" align="center"><input name="submit1" class="btn" type="submit" onclick="return pd();" value="查询"></td>
				</tr>
			</table>
				<br />
			<logic:present name="Pw_membersRange"> 
				<table width="100%" align="center">
					<input type="hidden" name="hiddenuid" value="list"/>
					<tr>
		    		<th class="td_01" height="25px">用户ID</th>
			    	<th class="td_01">用户名</th>

			    	<th class="td_01">真实名</th>
			    	
			    	<th class="td_01">城市</th>
			    	
			    	<th class="td_01">电话</th>
			    	<th class="td_01">Vip卡号</th>
			    	
			    	<th class="td_01">积分</th>
			    	<th class="td_01">注册日期</th>
			    	
			    	<th class="td_01">操作</th>
		   		 </tr>
				 
					<logic:iterate id="pw_members" name="Pw_membersRange" property="records">
						<tr>
							<td class="td_03" nowrap><a href="${ctx}/pw_members/pw_membersManage.do?method=queryById&memberId=${pw_members.uid}">${pw_members.uid}</a></td>
							<td class="td_03">${pw_members.username}</td>
							<td class="td_03" nowrap>${pw_members.realName}</td>
							
							<td class="td_03">${pw_members.province}&nbsp;${pw_members.rcity}&nbsp;${pw_members.town}</td>
							
							<td class="td_03">${pw_members.mobile}</td>
							<td class="td_03">${pw_members.vip}</td>
							
							<td class="td_03" nowrap>${pw_members.point}</td>
							<bean:define id="regDate" name="pw_members" property="regDate" />
							<td class="td_03" nowrap><%=com.safeai.util.DateUtil.printLongTime(new Long(((Long)regDate).longValue()*1000))%></td>
							
							<td class="td_03">
	                            <a href= "#" onclick="document.getElementById('hUid').value='${pw_members.uid}';document.getElementById('hiddenfrom').submit();">修改</a>
								<a href="#" onmousedown="if(confirm('是否删除？')==true) location.href='${ctx}/pw_members/pw_membersManage.do?method=deletePw_members&pw_members.uid=${pw_members.uid}'">删除</a>
	                            <a href= "${ctx}/point.do?method=queryList&point.customerId=${pw_members.uid}">积分记录</a>
                            </td>
						</tr>
					</logic:iterate>
					<tr>
						<td colspan="9" align="right">
                        <div style="float:left">&nbsp;&nbsp;
                        <a href="${ctx}/pw_members/pw_membersManage.do?method=toAddPw_members">添加</a>
                        </div>
                        <%@ include file="/pages/safeai/jsp/common/page.jsp"%>&nbsp;&nbsp;&nbsp;&nbsp;
                        </td>
					</tr>
				</table>
			</logic:present>
		</form>
		<form  action="${ctx}/pw_members/pw_membersManage.do?method=toUpdatePw_members" method="post"  name="pw_membersForm" id="hiddenfrom">
			<input type="hidden" name="pw_members.uid" id="hUid"/>
			<input type="hidden" name="pw_members.uidStr" value="${pwMember.uidStr}"/>
			<input type="hidden" name="pw_members.username" value="${pwMember.username}"/>
			<input type="hidden" name="pw_members.realName" value="${pwMember.realName}"/>
			<input type="hidden" name="pw_members.email" value="${pwMember.email}"/>
			<input type="hidden" name="pw_members.mobile" value="${pwMember.mobile}"/>
			<input type="hidden" name="pw_members.vip" value="${pwMember.vip}"/>
			<input type="hidden" name="pw_members.redate"value="${pwMember.redate}"/>
            <input type="hidden" name="pw_members.brandId"value="${pwMember.brandId}"/>
		</form>
	</body>
</html>
<script language="javascript"> 
	function gotoPage(pageOffset, pageSize) {
			var form = document.getElementsByTagName("form")[0];
			form.elements["pager.offset"].value = pageOffset;
			form.elements["pageSize"].value = pageSize;
			form.submit();
	}
	function pd(){
		var puid = document.getElementById("puid").value;
		var vip = document.getElementById("vip").value;
		if(puid!=""){
			if(puid.length>8){
				alert("ID的最大长度为8位!");
				return false;
			}
			var Letters = "0123456789";
			var c;
		 	for( i = 0; i < puid.length+1; i ++ ){					
			  	c = puid.charAt(i);
				if (Letters.indexOf(c) !=c){
					alert("ID不能包含字符!");
					return false;
				}
			}
		}
		if(vip!=""){
			var Letters = "0123456789";
			var c;
		 	for( i = 0; i < vip.length+1; i ++ ){					
			  	c = vip.charAt(i);
				if (Letters.indexOf(c) !=c){
					alert("ID不能包含字符!");
					return false;
				}
			}
		}
	}
</script>